package com.patrol.logisticsmanage.ui.base;


import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import java.lang.reflect.Field;

public class BaseFragment extends Fragment {
    protected LayoutInflater inflater;
    private View contentView;
    private Context context;
    private ViewGroup container;

    public BaseFragment() {
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.context = this.getActivity().getApplicationContext();
    }

    public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        this.inflater = inflater;
        this.container = container;
        this.onCreateView(savedInstanceState);
        return this.contentView == null ? super.onCreateView(inflater, container, savedInstanceState) : this.contentView;
    }

    protected void onCreateView(Bundle savedInstanceState) {
    }

    public void onDestroyView() {
        super.onDestroyView();
        this.contentView = null;
        this.container = null;
        this.inflater = null;
    }

    public Context getApplicationContext() {
        return this.context;
    }

    public void setContentView(int layoutResID) {
        this.setContentView((ViewGroup)this.inflater.inflate(layoutResID, this.container, false));
    }

    public void setContentView(View view) {
        this.contentView = view;
    }

    public View getContentView() {
        return this.contentView;
    }

    public View findViewById(int id) {
        return this.contentView != null ? this.contentView.findViewById(id) : null;
    }

    public void onDetach() {
        super.onDetach();


    }
}
